package com.bluesky.plum.uimodels.standard.components.objectBrowser;

import java.util.List;

/**
 * Object Provider can attach to a Object Repository.<br>
 * if the object repository support paging, that is good. the object provider
 * always hold the limited number of entities that retrieved from repository. so
 * we can access the entity by index, which means we avoid ID by relying on
 * index. Because I think avoiding ID is better than introduce it.maybe ID is
 * inevitable in database and ORM.
 * 
 * @author jack
 * 
 * @param <T>
 */
public interface ObjectProvider<T> {
	
	public interface Paging {
		// paging support
		boolean getPaging();

		void setPaging(boolean paging);

		void setPageSize(int size);

		void setPageNumber(int number);

		int getPageCount();

	}

	/***
	 * paging is optional
	 * @return
	 */
	Paging getPaging();
	void setPaging(Paging paging);
	
	
	List<T> list();


}
